//
//  AddGoodsself.m
//  Shengzhuli
//
//  Created by subook on 16/8/26.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "AddGoodsModel.h"

@implementation AddGoodsModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        self.productNo = dict[@"productNo"];
        self.isInIndexActivity = [dict[@"isInIndexActivity"] integerValue];
        self.productType = dict[@"productType"];
        self.productTypeOne = dict[@"productTypeOne"];
        self.name = dict[@"name"];
        self.subtitle = dict[@"subtitle"];
        self.price = [dict[@"price"] floatValue];
        self.freightInMaxCount = [dict[@"freightInMaxCount"] floatValue];
        self.freightInEveryAdd = [dict[@"freightInEveryAdd"] floatValue];
        self.productBanner = dict[@"productBanner"];
        self.productDetail = dict[@"productDetail"];
        self.bannerUrl = dict[@"bannerUrl"];
        [self.productBannerList addObjectsFromArray:dict[@"productBannerList"]];
        [self.productDetailList addObjectsFromArray:dict[@"productDetailList"]];
        [self.bannerList addObjectsFromArray:dict[@"bannerList"]];
        self.thumbnailUrl = dict[@"thumbnailUrl"];
        self.productInShopCarCount = [dict[@"productInShopCarCount"] integerValue];
        self.isfollow = [dict[@"isfollow"] boolValue];
        self.recommendName = dict[@"recommendName"];
        
        
        self.freightMaxCount = [dict[@"freightMaxCount"] integerValue];
        self.stockCount = [dict[@"stockCount"] integerValue];
        self.productParams = dict[@"productParams"];
        self.productBannerUrl = dict[@"productBannerUrl"];
        self.bannerUrl = dict[@"bannerUrl"];
        self.indexActivityImage = dict[@"indexActivityImage"];
        self.indexActivityPosition = [dict[@"indexActivityPosition"] integerValue];
        
        self.status = dict[@"status"];
        self.productDetail = dict[@"productDetail"];
        self.residualStock = dict[@"residualStock"];
        self.bannerType = dict[@"bannerType"];
        self.alreadySoldCount = dict[@"alreadySoldCount"];
        self.isInIndexActivity = [dict[@"isInIndexActivity"] integerValue];
        self.latitude = dict[@"latitude"];
        self.shopId = dict[@"shopId"];
        self.sort = dict[@"sort"];
        self.ID = [dict[@"id"] integerValue];
        self.longitude = dict[@"longitude"];
        self.updateDate = dict[@"updateDate"];
        self.shopAddressDetail = dict[@"shopAddressDetail"];
        self.shopMobilePhone = dict[@"shopMobilePhone"];
        self.commentNum = [dict[@"commentNum"] integerValue];
        //活跃值
        self.activeValue = [dict[@"activeValue"] floatValue];
    }
    return self;
}

+ (instancetype)objectWithDict:(NSDictionary *)dict
{
    return [[AddGoodsModel alloc]initWithDict:dict];
}
- (NSMutableArray *)productBannerList
{
    if (!_productBannerList) {
        _productBannerList = [NSMutableArray array];
    }
    return _productBannerList;
}
- (NSMutableArray *)productDetailList
{
    if (!_productDetailList) {
        _productDetailList = [NSMutableArray array];
    }
    return _productDetailList;
}
- (NSMutableArray *)bannerList
{
    if (!_bannerList) {
        _bannerList = [NSMutableArray array];
    }
    return _bannerList;
}
@end
